<template>
  <div id="app">
    <Topbar></Topbar>
    <Header></Header>
    <router-view />
    <Footer></Footer>
    <Login v-show="isShowLoginModal"></Login>
    <!-- 提示框组件 -->
    <Toast v-show="isShowToast"></Toast>
  </div>
</template>

<script>
import Topbar from "@/components/Topbar.vue";
import Header from "@/components/Header.vue";
import Footer from "@/components/Footer.vue";
import Toast from "@/components/Toast.vue";
import { Jp, Rm } from "@/requeset/api.js";
import Login from "@/components/Login.vue";
import { mapState } from "vuex";
export default {
  components: {
    Topbar,
    Header,
    Footer,
    Login,
    Toast,
  },
  async created() {
    let res = await Jp();
    console.log("精品", res);
    let rm = await Rm();
    console.log("推荐", rm);
  },
  computed: {
    ...mapState({
      isShowLoginModal: (state) => state.isShowMoadl.isShowLoginModal,
      isShowToast: (state) => state.ShowToast.isShowToast,
    }),
  },
};
</script>
<style lang="less">
h1 {
  background-color: tomato;
}
.wrap {
  width: 1200px;
  margin: 0 auto;
}
</style>
